package com.zp.self.springboot.自动装配.ImportSelector接口;

import com.zp.self.springboot.自动装配.Circle;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

//3. 创建配置类，
// 在原来Circle的基础上,
// 还导入: MyImportSelector-->Person
@Import({Circle.class, MyImportSelector.class})
@Configuration
public class MyAutoConfig {

    //测试
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(MyAutoConfig.class);
        Circle circle = context.getBean(Circle.class);
        Person triangle = context.getBean(Person.class);
        circle.sayHi();
        triangle.sayHi();

    }


} 